#!/bin/bash
# this is sample script, put it to ~/.gnomepipeapplet/script.sh
# Important note: this script is "blocking" gnome panel while it runs, so if you put here some wget and it will be downloading something 
# for 2 minutes, gnome panel will not start for 2 minutes, so keep it fast

# disk/partition with minimal free space
FreeDiskSpace=`df | grep '^\/dev' | awk '{ printf("%1.2f\n",$4/1000/1000) }' | sort -n | head -1`

# end of world calculation
A=`date +%s`
B=`date +%s -d "2012/12/21"`
DNI=$((($B-$A)/86400))
DDDD=$DNI
MES=$(($DNI/30))
DD=$(($DNI-$MES*30))
DOM=$DDDD" days"

# final output
echo -n $FreeDiskSpace" GB  $DOM"

